﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConsoleApp1.game1;
using ConsoleApp1.game2;
using ConsoleApp1.game3;

namespace ConsoleApp1
{
    class product
    {
        /*
        入库产品
        参数：入库数量（salecount）
        返回值：无
        */
        public void saleWarehousing(int salecount)
        {
            Shooting sho = new Shooting();
            dota dot = new dota();
            existence exi = new existence();
            sho.count += salecount;
            dot.count += salecount;
            exi.count += salecount;
        }
        /*
        销售产品
        参数：销售数量（salecount）
        返回值：成功/失败(bool)
        */
        public bool Sale(int salecount)       
        {
            Shooting sho = new Shooting();
            dota dot = new dota();
            existence exi = new existence();
            if (salecount<= sho.count|| salecount <= dot.count || salecount <= exi.count)
            {
                sho.count -= salecount;
                dot.count -= salecount;
                exi.count -= salecount;
                return true;
            }
            else
            {
                Console.WriteLine("此产品库存不足，请尽快补货！");
                return false;
            }
        }
    }
}
